//=====================================================================
//
//
//
//=====================================================================
#ifndef KALEIDOSCOPE_RESOLVE_HPP
#define KALEIDOSCOPE_RESOLVE_HPP
//=====================================================================
#include <sooty/frontend/syntactic_analysis/parseme.hpp>
#include <sooty/frontend/semantic_analysis/symbol_table.hpp>
//=====================================================================
#include <kaleidoscope/kaleidoscope.hpp>
//#include <kaleidoscope/frontend/semantic_analysis/scope.hpp>
//=====================================================================
KALEIDOSCOPE_BEGIN
//=====================================================================
/*
	namespace resolve
	{
		namespace closeness
		{
			enum Enum
			{
				not_at_all,
				castable,
				perfect
			};
		}
	}
	
	namespace resolve
	{
		namespace equal
		{
			struct function_call_vs_function
				: std::unary_function<atma::sooty::parseme_ptr, bool>
			{
				function_call_vs_function(
					atma::sooty::const_parseme_ptr_ref call,
					closeness::Enum closeness = closeness::perfect
				)
					: call_(call), scope_(scope), closeness_(closeness)
				{
				}
				
				bool operator ()(atma::sooty::const_parseme_ptr_ref) const;
			
			private:
				atma::sooty::parseme_ptr call_;
				mutable scopeme_ptr scope_;
				closeness::Enum closeness_;
			};
		}
		
		// removes all functions that don't match the arguments up to a specified closeness
		void remove_nonmatching_functions(
			atma::sooty::parseme_container&,
			atma::sooty::const_parseme_ptr_ref,
			closeness::Enum);
		
		
		
		// these functions figure out how close something is to something else...
		// - does a lot of forwarding of arguments to other functions
		closeness::Enum types(atma::sooty::const_parseme_ptr_ref, atma::sooty::const_parseme_ptr_ref, scopeme_ptr_ref);
		
		//
		closeness::Enum function_call_against_function(atma::sooty::const_parseme_ptr_ref call, atma::sooty::const_parseme_ptr_ref function, scopeme_ptr_ref);
		//function_call_against_functions(atma::sooty::const_parseme_ptr_ref call, const atma::sooty::parseme_container& functions, scopeme_ptr_ref);
		closeness::Enum function_against_function(atma::sooty::const_parseme_ptr_ref, atma::sooty::const_parseme_ptr_ref, scopeme_ptr_ref);
		
		// because function_call_against_function and function_against_function are identical, extrapolate it out
		namespace detail {
			closeness::Enum function_type(atma::sooty::const_parseme_ptr_ref, atma::sooty::const_parseme_ptr_ref, scopeme_ptr_ref);
		}
	}
	
*/	
//=====================================================================
KALEIDOSCOPE_CLOSE
//=====================================================================
#endif
//=====================================================================
